package com.jeeplus.modules.guide.service;

import com.jeeplus.database.datasource.annotation.DS;
import com.jeeplus.modules.guide.mapper.MatterBusinessMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.*;

@DS("queuing")
@RequiredArgsConstructor
@Service
@Slf4j
public class MatterBusinessService {
    private final MatterBusinessMapper businessMapper;
//    private final WarningMapper warningMapper;

    public List<Map<String, String>> getBusiness(String sysno, String no) {
        List<Map<String, String>> list = new ArrayList();
        Map<String, String> window = businessMapper.getWindow(sysno, no);
        if (window != null) {
            for (Map.Entry<String, String> entry : window.entrySet()) {
                if (!"".equals(entry.getValue()) && null != entry.getValue()) {
                    String[] split = entry.getValue().split("-");
                    for (String s : split) {
                        list.addAll(businessMapper.getBusiness(sysno, s));
                    }

                }
            }

        }
        return list;
    }



}
